package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Anomalie generated by hbm2java
 */
@Entity
@Table(name = "Anomalie", schema = "dbo", catalog = "CRM")
public class Anomalie implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int anomalieId;
	private ElementContrat elementContrat;
	private Client client;
	private Date dateCreation;
	private String etat;
	private Date dateCloture;
	private String description;
	private Set<AffectationAnomalie> affectationAnomalies = new HashSet<AffectationAnomalie>(0);

	public Anomalie() {
	}

	public Anomalie(int anomalieId) {
		this.anomalieId = anomalieId;
	}

	public Anomalie(int anomalieId, ElementContrat elementContrat,
			Client client, Date dateCreation, String etat, Date dateCloture,
			String description, Set<AffectationAnomalie> affectationAnomalies) {
		this.anomalieId = anomalieId;
		this.elementContrat = elementContrat;
		this.client = client;
		this.dateCreation = dateCreation;
		this.etat = etat;
		this.dateCloture = dateCloture;
		this.description = description;
		this.affectationAnomalies = affectationAnomalies;
	}

	@Id
	@GeneratedValue
	@Column(name = "AnomalieId", unique = true, nullable = false)
	public int getAnomalieId() {
		return this.anomalieId;
	}

	public void setAnomalieId(int anomalieId) {
		this.anomalieId = anomalieId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ElementContratId")
	public ElementContrat getElementContrat() {
		return this.elementContrat;
	}

	public void setElementContrat(ElementContrat elementContrat) {
		this.elementContrat = elementContrat;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "clientId")
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateCreation", length = 23)
	public Date getDateCreation() {
		return this.dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	@Column(name = "etat", length = 10)
	public String getEtat() {
		return this.etat;
	}

	public void setEtat(String etat) {
		this.etat = etat;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateCloture", length = 23)
	public Date getDateCloture() {
		return this.dateCloture;
	}

	public void setDateCloture(Date dateCloture) {
		this.dateCloture = dateCloture;
	}

	@Column(name = "description", length = 50)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "anomalie")
	public Set<AffectationAnomalie> getAffectationAnomalies() {
		return this.affectationAnomalies;
	}

	public void setAffectationAnomalies(Set<AffectationAnomalie> affectationAnomalies) {
		this.affectationAnomalies = affectationAnomalies;
	}

}
